<html>
<head>
<style type="text/css"> 
#myModal {
    position:absolute;
    top: 25%;
    left: 50%;
    width:30em;
    height:18em;
    margin-top: -9em; /*set to a negative number 1/2 of your height*/
    margin-left: -15em; /*set to a negative number 1/2 of your width*/
    border: 1px solid #ccc;
    background-color: #f3f3f3;
}

</style>

<script>

function myFunction()
{


 <% @allProjects.each do |project| %>
<% if project.program == @program.id %>
 $('<div   style="background-color:white;" class="accordion-group"><div  style=" border:1px solid <%=@program.colour_id%>;" class="accordion-heading"><a style=" border-right:60px solid <%=@program.colour_id%>;"  class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href=<%="#"+project.name%>><%=project.name%></a></div><div id=<%=project.name%>  style="background-color:white;" class="accordion-body collapse"><div   style=" border:1px solid <%=@program.colour_id%>;"p = pclass="accordion-inner">&nbsp;&nbsp;&nbsp;<div style="margin-top:10px;width:90px;display:inline-block"><%= image_tag(project.photo.url, :size => "200x100") %></div><div style="float-left:10px;vertical-align:top;margin-left:20px;height:230px;display:inline-block;width:340px;"><h3><%= link_to project.name, {:controller => "projects", :action => "show", :id => project.id} %></h3><p><%= (project.summary).html_safe%></p></div></div> </div></div>').appendTo("#accordion2");
  <% end %>
<% end %>

}
</script>
</head>

<body onload="myFunction()">
<div class="row">

			<div class="span8">
				<div style="padding-left:20px">
				<h3><%=(@program.name).html_safe%></h3>
					<div style="margin-top:10px;width:1000px;display:inline-block">
						<%= image_tag(@program.photo.url, :size => "500x300") %>
					</div>
					
					<div id = "program-area" >
					
					<% if admin_authenticated? %>
					
					<p><%= link_to "[edit]" , edit_program_path(@program)%> </p>
					<% end %>
					
						
						
						</br>
						<p><%=(@program.description).html_safe %></p>
					
					</div>
					

					<div class="accordion" id="accordion2">
   
					</div>

				</div>

			</div>
			
			
			<div class="span4">
				<div style="border-left:1px solid #a0a0a0;padding-left:20px;padding-top:20px;width:330px;">
					<% @allTestimonials.each do |t| %>
				<% if t.program == @program.id %> 
					<a href="<%= t.image_link%>" style="color:black"><div style="vertical-align:center;margin-bottom:20px;margin-right:10px;padding:10px;display:table;background-color:#eeeee0">
						<div style="vertical-align:middle;display:table-cell"> <%= image_tag(t.photo.url, :size => "200x200", :class => "img-rounded") %> </div>
						
					</div></a>
					<% end %> 
					<% end %>
				</div>
			</div>

		</div>
		
		

</body>

</html>
